import struct, sys, os, time
from platform import python_version
from ip2Region import Ip2Region

dbFile = 'D:/k12日志分析测试/lionsoul-ip2region-master/ip2region/data/ip2region.db'
#line = '119.31.165.154'
line = '117.15.137.229'
searcher = Ip2Region(dbFile)
ret = searcher.btreeSearch(line)
print('city_id: %s, region: %s'%(ret.get('city_id'),ret.get('region').decode('utf-8')))
